package com.hnchances.mapper;

import com.hnchances.entity.Grades;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface ScoreMapper {

    int insert(Grades grade);

    int update(Grades grade);

    int deleteById(@Param("id") Long id);

    Grades selectById(@Param("id") Long id);

    /**
     * 多条件查询：学生姓名、班级名称、课程名称、考试名称
     */
    @MapKey("id")
    List<Map<String, Object>> selectByCondition(
            @Param("studentName") String studentName,
            @Param("className") String className,
            @Param("courseName") String courseName,
            @Param("examName") String examName
    );
}